package com.broada.apm.es.indices.support;

import org.elasticsearch.common.settings.Settings;

import com.broada.apm.es.indices.IndicesManager;
import com.broada.apm.indicator.api.common.ApmDataIndicatorException;

/**
 * 
 * base index管理类
 * 
 * @author louyi Create By 2014-11-21 上午10:56:20
 */
public abstract class AbstractIndicesBuilder {
	private IndicesManager indicesManage = IndicesManager.getInstance();

	protected void buildIndex(String index,Settings settings) throws Exception {
		indicesManage.buildIndex(index,settings);
	}
	
	protected void buildIndex(String index) throws Exception {
		indicesManage.buildIndex(index);
	}
	
	public boolean existsIndex(String index) throws ApmDataIndicatorException{
		return indicesManage.existsIndex(index);
	}

	public String[] searchIndex(String...index) throws ApmDataIndicatorException {
		return indicesManage.searchIndex(index);
	}

	public boolean deleteIndex(String... indices) throws ApmDataIndicatorException {
		return indicesManage.deleteIndex(indices);
	}
	
	public boolean deleteFromCache(String... indices) throws ApmDataIndicatorException {
		return indicesManage.deleteFromCache(indices);
	}

}